<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    {include file="common/head" /}
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <table class="layui-table" lay-even>
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>
            <tr>
                <td>ID</td>
                <td>{$info.id}</td>
            </tr>
            <tr>
                <td>会员</td>
                <td>{$info['user']['mobile']}</td>
            </tr>
            <tr>
                <td>申请提现金额</td>
                <td>{$info['refund_money']}</td>
            </tr>
            <tr>
                <td>提现手续费</td>
                <td>{$info.refund_system_take}</td>
            </tr>
            <tr class="x-red">
                <td>实际到账金额</td>
                <td>{$info.refund_price|default=0}</td>
            </tr>
            <tr class="x-red">
                <td>提现至</td>
                <td>
                    {$info['refund_to']|arrText=['wechat'=>'微信','alipay'=>'支付宝','bank'=>'银行卡']}
                </td>
            </tr>

            {eq name="info['refund_to']" value="wechat"}
            <tr class="x-red">
                <td>微信账号</td>
                <td>{$info['user']['wechat_user']}</td>
            </tr>
            {/eq}
            {eq name="info['refund_to']" value="alipay"}
            <tr class="x-red">
                <td>支付宝账号</td>
                <td>{$info['user']['alipay_user']}</td>
            </tr>
            {/eq}
            {eq name="info['refund_to']" value="bank"}
            <tr class="x-red">
                <td>银行卡账号</td>
                <td>
                    <table class="layui-table" lay-even>
                        <colgroup>
                            <col width="150">
                            <col>
                        </colgroup>
                        <tbody>
                        <tr>
                            <td>银行卡户主名</td>
                            <td>{$info['bank']['bank_real_name']}</td>
                        </tr>
                        <tr>
                            <td>银行名称</td>
                            <td>{$info['bank']['bank_name']}</td>
                        </tr>
                        <tr>
                            <td>银行账号</td>
                            <td>{$info['bank']['bank_numb']}</td>
                        </tr>
                        <tr>
                            <td>支付行</td>
                            <td>{$info['bank']['bank_branch']}</td>
                        </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            {/eq}

            <tr>
                <td>处理时间</td>
                <td>{$info.refund_finish_time|date='Y-m-d H:i:s'}</td>
            </tr>

            <tr>
                <td>申请来源</td>
                <td>{$info.refund_type}</td>
            </tr>

            <tr>
                <td>操作管理员</td>
                <td>{$info['admin']['nickname']}</td>
            </tr>
            <tr>
                <td>申请时间</td>
                <td>{$info.create_time|date='Y-m-d H:i:s'}</td>
            </tr>
            <tr>
                <td>状态</td>
                <td>{$info['status']?'已提现':'申请中'}</td>
            </tr>

            <tr>
                <td>备注</td>
                <td>{$info.memo}</td>
            </tr>
            </tbody>
        </table>

    </div>
</div>

<div id="idbox" style="display: none">

</div>
<script>layui.use(['form', 'layer'],
    function () {
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;

        //自定义验证规则
        form.verify({
            mobile: function (value) {
                if (!new RegExp("^1[3456789]\\d{9}$").test(value)) {
                    return '请填写正确的手机号';
                }
            },

            pwd: function (value) {
                if (value.len<6) {
                    return '密码请设置6位以上的字符';
                }
            }
        });

        //监听提交
        form.on('submit(add)',
            function (data) {
                $.ajax({
                    type: "POST",
                    url: "{:url()}",
                    data: data.field,
                    success: function (result) {

                        if(result.code){
                            layer.alert(result.msg, {
                                icon: 6
                            }, function () {
                                xadmin.close();
                            });
                        }else{
                            layer.alert(result.msg,{
                                icon: 2
                            });
                        }

                    },
                    error: function (result) {
                        layer.alert(result.msg, {
                            icon: 2
                        }, function () {
                            xadmin.close();
                        });
                    }

                });
                return false;
            });


    });
</script>

</body>

</html>
